package com.example.hehecat.yuejian1.ui.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.hehecat.yuejian1.R;
import com.example.hehecat.yuejian1.mvp.model.api.Api;
import com.example.hehecat.yuejian1.mvp.model.bean.GameBean;
import com.squareup.picasso.Picasso;

public class GameListAdapter  extends BaseQuickAdapter<GameBean, BaseViewHolder> {
    private Context context;

    public GameListAdapter(int layoutResId, Context context) {
        super(layoutResId);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, GameBean item) {
        helper.setText(R.id.item_name,item.getGamename())
                .setText(R.id.item_intro,String.valueOf(item.getIntro()))
                .setText(R.id.item_date,item.getStartdate());

        Picasso.with(context).load(Api.IMG_URL+item.getGameimg()).into((ImageView) helper.getView(R.id.master_pic));
    }
}
